<?php
/*
	插件概览
		
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'welcome';
if($_RQ['op']=='welcome'){
	//会员
	$params=array('merchid'=>$_SESSION['onemerchid'],'uniacid'=>$_SESSION['uniacid'],'is_team'=>1,'plugin_name'=>'jy_pingdd_pin');
	$member=array(
		'num'=>pdo_count('jy_weishop_order',$params),
		'price'=>pdo_getsum('jy_weishop_order',$params,'price'),
	);
	$return['htmls'][]=array('type'=>'data','one_num'=>6,'title'=>'参与概况','datas'=>array(
		array('title'=>'拼团次数','num'=>1,'data'=>$member['num']),
		array('title'=>'拼团金额','num'=>1,'data'=>$member['price']),
	));
	//趋势
	$order_params=array(
		'title'=>'近30天拼团次数走势',
		'data'=>array(
			'tablename'=>'jy_weishop_order',
			'params'=>$params,
		),
	);
	$return['htmls'][]=model('core/echart')->line($order_params);
	$member_params=array(
		'title'=>'近三十天次数/金额增长走势',
		'data'=>array(
			'次数增长'=>array(
				'tablename'=>'jy_weishop_order',
				'params'=>$params,
			),
			'金额增长'=>array(
				'tablename'=>'jy_weishop_order',
				'params'=>$params,
			)
		),
	);
	$return['htmls'][]=model('core/echart')->line($member_params);
	set_html('title','参与概况');
	exi($return);
}